.class public Lrexsee/advertisement/AdDiv;
.super Lrexsee/core/widget/Div;
.source "AdDiv.java"


# static fields
.field public static final AD_WO:Ljava/lang/String; = "wo"


# instance fields
.field public final mAdView:Landroid/view/View;

.field public final mBrowser:Lrexsee/core/browser/Browser;

.field public final mId:Ljava/lang/String;

.field public final mKey:Ljava/lang/String;

.field public final mVendor:Ljava/lang/String;


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 1
    .param p1, "browser"    # Lrexsee/core/browser/Browser;
    .param p2, "id"    # Ljava/lang/String;
    .param p3, "adVendor"    # Ljava/lang/String;
    .param p4, "adKey"    # Ljava/lang/String;
    .param p5, "style"    # Ljava/lang/String;

    .prologue
    .line 25
    invoke-virtual {p1}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-direct {p0, v0}, Lrexsee/core/widget/Div;-><init>(Landroid/content/Context;)V

    .line 26
    invoke-virtual {p0, p5}, Lrexsee/advertisement/AdDiv;->setStyle(Ljava/lang/String;)V

    .line 27
    iput-object p1, p0, Lrexsee/advertisement/AdDiv;->mBrowser:Lrexsee/core/browser/Browser;

    .line 28
    iput-object p2, p0, Lrexsee/advertisement/AdDiv;->mId:Ljava/lang/String;

    .line 29
    iput-object p3, p0, Lrexsee/advertisement/AdDiv;->mVendor:Ljava/lang/String;

    .line 30
    iput-object p4, p0, Lrexsee/advertisement/AdDiv;->mKey:Ljava/lang/String;

    .line 31
    invoke-static {p3}, Lrexsee/advertisement/AdDiv;->isVendorReady(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 32
    const/4 v0, 0x0

    iput-object v0, p0, Lrexsee/advertisement/AdDiv;->mAdView:Landroid/view/View;

    .line 37
    :goto_0
    return-void

    .line 34
    :cond_0
    invoke-direct {p0}, Lrexsee/advertisement/AdDiv;->getVendorView()Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lrexsee/advertisement/AdDiv;->mAdView:Landroid/view/View;

    .line 35
    iget-object v0, p0, Lrexsee/advertisement/AdDiv;->mAdView:Landroid/view/View;

    invoke-virtual {p0, v0}, Lrexsee/advertisement/AdDiv;->addChild(Landroid/view/View;)V

    goto :goto_0
.end method

.method private getVendorView()Landroid/view/View;
    .locals 5

    .prologue
    .line 40
    iget-object v3, p0, Lrexsee/advertisement/AdDiv;->mVendor:Ljava/lang/String;

    const-string v4, "wo"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_9

    .line 41
    new-instance v2, Lcom/wostore/adsdk/ADSdkView;

    iget-object v3, p0, Lrexsee/advertisement/AdDiv;->mContext:Landroid/content/Context;

    invoke-direct {v2, v3}, Lcom/wostore/adsdk/ADSdkView;-><init>(Landroid/content/Context;)V

    .line 42
    .local v2, "view":Lcom/wostore/adsdk/ADSdkView;
    iget-object v3, p0, Lrexsee/advertisement/AdDiv;->mKey:Ljava/lang/String;

    invoke-virtual {v2, v3}, Lcom/wostore/adsdk/ADSdkView;->setPublisherID(Ljava/lang/String;)V

    .line 43
    iget-object v3, p0, Lrexsee/advertisement/AdDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->background_color:Ljava/lang/String;

    invoke-static {v3}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I

    move-result v3

    invoke-virtual {v2, v3}, Lcom/wostore/adsdk/ADSdkView;->setADbackgroundColor(I)V

    .line 44
    iget-object v3, p0, Lrexsee/advertisement/AdDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->color:Ljava/lang/String;

    invoke-static {v3}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I

    move-result v3

    invoke-virtual {v2, v3}, Lcom/wostore/adsdk/ADSdkView;->setADtextColor(I)V

    .line 45
    iget-object v3, p0, Lrexsee/advertisement/AdDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->font_size:Ljava/lang/String;

    const/16 v4, 0x18

    invoke-static {v3, v4}, Lrexsee/core/utilities/Utilities;->getInt(Ljava/lang/String;I)I

    move-result v3

    invoke-virtual {v2, v3}, Lcom/wostore/adsdk/ADSdkView;->setADtextSize(I)V

    .line 46
    iget-object v3, p0, Lrexsee/advertisement/AdDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->window_fullscreen:Ljava/lang/String;

    const-string v4, "true"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_2

    .line 47
    sget-object v3, Lcom/wostore/adsdk/ADCfg$AdType;->fullscreen:Lcom/wostore/adsdk/ADCfg$AdType;

    invoke-virtual {v2, v3}, Lcom/wostore/adsdk/ADSdkView;->setADtype(Lcom/wostore/adsdk/ADCfg$AdType;)V

    .line 48
    iget-object v3, p0, Lrexsee/advertisement/AdDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->window_auto_hide:Ljava/lang/String;

    const/4 v4, -0x1

    invoke-static {v3, v4}, Lrexsee/core/utilities/Utilities;->getInt(Ljava/lang/String;I)I

    move-result v3

    int-to-short v1, v3

    .line 49
    .local v1, "fullscreenduration":S
    if-lez v1, :cond_1

    move v3, v1

    :goto_0
    invoke-virtual {v2, v3}, Lcom/wostore/adsdk/ADSdkView;->setADfullscreenduration(S)V

    .line 53
    .end local v1    # "fullscreenduration":S
    :goto_1
    iget-object v3, p0, Lrexsee/advertisement/AdDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->duration:Ljava/lang/String;

    const/4 v4, 0x0

    invoke-static {v3, v4}, Lrexsee/core/utilities/Utilities;->getInt(Ljava/lang/String;I)I

    move-result v3

    int-to-short v0, v3

    .line 54
    .local v0, "duration":S
    const/16 v3, 0x3c

    if-lt v0, v3, :cond_0

    invoke-virtual {v2, v0}, Lcom/wostore/adsdk/ADSdkView;->setADrefreshInterval(S)V

    .line 55
    :cond_0
    iget-object v3, p0, Lrexsee/advertisement/AdDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->window_animation:Ljava/lang/String;

    const-string v4, "bottomPush"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_3

    .line 56
    sget-object v3, Lcom/wostore/adsdk/ADCfg$ADtransition;->bottomPush:Lcom/wostore/adsdk/ADCfg$ADtransition;

    invoke-virtual {v2, v3}, Lcom/wostore/adsdk/ADSdkView;->setADtransition(Lcom/wostore/adsdk/ADCfg$ADtransition;)V

    .line 70
    :goto_2
    iget-object v3, p0, Lrexsee/advertisement/AdDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->mode:Ljava/lang/String;

    const-string v4, "test"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v3

    invoke-virtual {v2, v3}, Lcom/wostore/adsdk/ADSdkView;->setTestMode(Z)V

    .line 71
    new-instance v3, Lrexsee/advertisement/AdDiv$1;

    invoke-direct {v3, p0}, Lrexsee/advertisement/AdDiv$1;-><init>(Lrexsee/advertisement/AdDiv;)V

    invoke-virtual {v2, v3}, Lcom/wostore/adsdk/ADSdkView;->setAdclicked_listener(Lcom/wostore/adsdk/ADSdkView$ZadSdkListenerAdClicked;)V

    .line 77
    new-instance v3, Lrexsee/advertisement/AdDiv$2;

    invoke-direct {v3, p0}, Lrexsee/advertisement/AdDiv$2;-><init>(Lrexsee/advertisement/AdDiv;)V

    invoke-virtual {v2, v3}, Lcom/wostore/adsdk/ADSdkView;->setAdloadsucceed_listener(Lcom/wostore/adsdk/ADSdkView$ZadSdkListenerLoadSucceed;)V

    .line 84
    new-instance v3, Lrexsee/advertisement/AdDiv$3;

    invoke-direct {v3, p0}, Lrexsee/advertisement/AdDiv$3;-><init>(Lrexsee/advertisement/AdDiv;)V

    invoke-virtual {v2, v3}, Lcom/wostore/adsdk/ADSdkView;->setAdLoadfailed_listener(Lcom/wostore/adsdk/ADSdkView$ZadSdkListenerLoadFailed;)V

    move-object v3, v2

    .line 93
    .end local v0    # "duration":S
    .end local v2    # "view":Lcom/wostore/adsdk/ADSdkView;
    :goto_3
    return-object v3

    .line 49
    .restart local v1    # "fullscreenduration":S
    .restart local v2    # "view":Lcom/wostore/adsdk/ADSdkView;
    :cond_1
    const/4 v3, 0x5

    goto :goto_0

    .line 51
    .end local v1    # "fullscreenduration":S
    :cond_2
    sget-object v3, Lcom/wostore/adsdk/ADCfg$AdType;->banner:Lcom/wostore/adsdk/ADCfg$AdType;

    invoke-virtual {v2, v3}, Lcom/wostore/adsdk/ADSdkView;->setADtype(Lcom/wostore/adsdk/ADCfg$AdType;)V

    goto :goto_1

    .line 57
    .restart local v0    # "duration":S
    :cond_3
    iget-object v3, p0, Lrexsee/advertisement/AdDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->window_animation:Ljava/lang/String;

    const-string v4, "fade"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_4

    .line 58
    sget-object v3, Lcom/wostore/adsdk/ADCfg$ADtransition;->fade:Lcom/wostore/adsdk/ADCfg$ADtransition;

    invoke-virtual {v2, v3}, Lcom/wostore/adsdk/ADSdkView;->setADtransition(Lcom/wostore/adsdk/ADCfg$ADtransition;)V

    goto :goto_2

    .line 59
    :cond_4
    iget-object v3, p0, Lrexsee/advertisement/AdDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->window_animation:Ljava/lang/String;

    const-string v4, "flipX"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_5

    .line 60
    sget-object v3, Lcom/wostore/adsdk/ADCfg$ADtransition;->flipX:Lcom/wostore/adsdk/ADCfg$ADtransition;

    invoke-virtual {v2, v3}, Lcom/wostore/adsdk/ADSdkView;->setADtransition(Lcom/wostore/adsdk/ADCfg$ADtransition;)V

    goto :goto_2

    .line 61
    :cond_5
    iget-object v3, p0, Lrexsee/advertisement/AdDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->window_animation:Ljava/lang/String;

    const-string v4, "leftPush"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_6

    .line 62
    sget-object v3, Lcom/wostore/adsdk/ADCfg$ADtransition;->leftPush:Lcom/wostore/adsdk/ADCfg$ADtransition;

    invoke-virtual {v2, v3}, Lcom/wostore/adsdk/ADSdkView;->setADtransition(Lcom/wostore/adsdk/ADCfg$ADtransition;)V

    goto :goto_2

    .line 63
    :cond_6
    iget-object v3, p0, Lrexsee/advertisement/AdDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->window_animation:Ljava/lang/String;

    const-string v4, "rightPush"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_7

    .line 64
    sget-object v3, Lcom/wostore/adsdk/ADCfg$ADtransition;->rightPush:Lcom/wostore/adsdk/ADCfg$ADtransition;

    invoke-virtual {v2, v3}, Lcom/wostore/adsdk/ADSdkView;->setADtransition(Lcom/wostore/adsdk/ADCfg$ADtransition;)V

    goto :goto_2

    .line 65
    :cond_7
    iget-object v3, p0, Lrexsee/advertisement/AdDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->window_animation:Ljava/lang/String;

    const-string v4, "topPush"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_8

    .line 66
    sget-object v3, Lcom/wostore/adsdk/ADCfg$ADtransition;->topPush:Lcom/wostore/adsdk/ADCfg$ADtransition;

    invoke-virtual {v2, v3}, Lcom/wostore/adsdk/ADSdkView;->setADtransition(Lcom/wostore/adsdk/ADCfg$ADtransition;)V

    goto/16 :goto_2

    .line 68
    :cond_8
    sget-object v3, Lcom/wostore/adsdk/ADCfg$ADtransition;->random:Lcom/wostore/adsdk/ADCfg$ADtransition;

    invoke-virtual {v2, v3}, Lcom/wostore/adsdk/ADSdkView;->setADtransition(Lcom/wostore/adsdk/ADCfg$ADtransition;)V

    goto/16 :goto_2

    .line 93
    .end local v0    # "duration":S
    .end local v2    # "view":Lcom/wostore/adsdk/ADSdkView;
    :cond_9
    const/4 v3, 0x0

    goto :goto_3
.end method

.method public static isVendorReady(Ljava/lang/String;)Z
    .locals 5
    .param p0, "adVendor"    # Ljava/lang/String;

    .prologue
    const/4 v4, 0x0

    .line 107
    const-string v3, "wo"

    invoke-virtual {p0, v3}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_0

    .line 108
    const-string v0, "com.wostore.adsdk.ADSdkView"

    .line 113
    .local v0, "className":Ljava/lang/String;
    :try_start_0
    invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
    :try_end_0
    .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    .line 114
    .local v1, "clazz":Ljava/lang/Class;, "Ljava/lang/Class<*>;"
    if-nez v1, :cond_1

    move v3, v4

    .line 116
    .end local v0    # "className":Ljava/lang/String;
    .end local v1    # "clazz":Ljava/lang/Class;, "Ljava/lang/Class<*>;"
    :goto_0
    return v3

    :cond_0
    move v3, v4

    .line 110
    goto :goto_0

    .line 114
    .restart local v0    # "className":Ljava/lang/String;
    .restart local v1    # "clazz":Ljava/lang/Class;, "Ljava/lang/Class<*>;"
    :cond_1
    const/4 v3, 0x1

    goto :goto_0

    .line 115
    .end local v1    # "clazz":Ljava/lang/Class;, "Ljava/lang/Class<*>;"
    :catch_0
    move-exception v2

    .local v2, "e":Ljava/lang/ClassNotFoundException;
    move v3, v4

    .line 116
    goto :goto_0
.end method


# virtual methods
.method public refresh()V
    .locals 2

    .prologue
    .line 98
    iget-object v0, p0, Lrexsee/advertisement/AdDiv;->mAdView:Landroid/view/View;

    if-nez v0, :cond_1

    .line 103
    .end local p0    # "this":Lrexsee/advertisement/AdDiv;
    :cond_0
    :goto_0
    return-void

    .line 99
    .restart local p0    # "this":Lrexsee/advertisement/AdDiv;
    :cond_1
    iget-object v0, p0, Lrexsee/advertisement/AdDiv;->mVendor:Ljava/lang/String;

    const-string v1, "wo"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 100
    iget-object p0, p0, Lrexsee/advertisement/AdDiv;->mAdView:Landroid/view/View;

    .end local p0    # "this":Lrexsee/advertisement/AdDiv;
    check-cast p0, Lcom/wostore/adsdk/ADSdkView;

    invoke-virtual {p0}, Lcom/wostore/adsdk/ADSdkView;->refreshAD()V

    goto :goto_0
.end method
